<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" charset="utf-8" />
<script type="text/javascript" src="jquery-1.9.1.js"></script>
<script type="text/javascript">

$(function(){
	
	$("#btn_sh").click(function(){
		var k="&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;"
		$("#weatherinfo").html("正在获取中，请稍等...");
		$.get("weather.do",function(data){
			var json=eval("("+data+")");
			var weatherinfo="上海城区：";
			weatherinfo+="气温："+json[1].weatherinfo.temp1+"~"+json[1].weatherinfo.temp2+k;
			weatherinfo+="相对湿度："+json[0].weatherinfo.SD+k;
			weatherinfo+="风向风力："+json[0].weatherinfo.WD+"&nbsp;"+json[0].weatherinfo.WS+k;
			weatherinfo+="数据更新时间："+json[0].weatherinfo.time;
			$("#weatherinfo").html(weatherinfo+"<br/><br/>");
			
			var aqiinfo="空气质量指数：";
			aqiinfo+=JSON.stringify(json[2]);
// 			aqiinfo=aqiinfo.replace("\"", "");
// 			aqiinfo=aqiinfo.replace("\"", "");
// 			$("#aqiinfo").html(aqiinfo+"<br/>");
// 			$("table").css("border","1px solid #000");
// 			$("table td").css("border","1px solid #000");
// 			$("table th").css("border","1px solid #000");
// 			$("table").css("width","100%");
			alert(json[2]);
			$("#aqiinfo").html(aqiinfo);
			
		})
	});
});
</script>
</head>
<body>
	<input type="button" id="btn_sh" value="获取上海天气及AQI信息" /><br/>
	<span id="weatherinfo"></span>
	<div id="aqiinfo"></div>
</body>
</html>